#ifndef DATABASESETTING_H
#define DATABASESETTING_H

#include <QSqlDatabase>
#include <QObject>
#include <QStringList>
#include "downloadtask.h"

class DataBaseSetting : public QObject
{
    Q_OBJECT
public:
    explicit DataBaseSetting(QObject *parent = 0);
    ~DataBaseSetting();
    bool init();

    QString dwnTableName();
    QStringList dwnTableColumn();
    QStringList dwnTableColumnType();

    QString urlTableName();
    QStringList urlTableColumn();
    QStringList urlTableColumnType();

    void getTaskForDownload(QVector<DownloadTask*> &tasks);

private:
    QSqlDatabase db;

    QString m_dwnTableName;
    QStringList m_dwnTableColumn;
    QStringList m_dwnTableColumnType;

    QString m_urlTableName;
    QStringList m_urlTableColumn;
    QStringList m_urlTableColumnType;

    QString getCreateDownloadTableQuery();
    QString getCreateUrlTableQuery();
    
signals:
    
public slots:
    
};

#endif // DATABASESETTING_H
